<%
var headerPart = {
%>
<style>
	html{background-color: #fff!important;}
</style>
<% }; %>
<% layout("/layouts/micro.html",{headerSection:headerPart}){ %>
	<div class="childrenBody">
     <div class="layui-tab-content">
		<form id="inputForm" action="${ctx}/sys/menu/save" method="post" class="layui-form">
			<input type="hidden" name="id" value="${menu.id}"/>

			<#message content="${message!}"/>

			<div class="layui-form-item">
				<label class="layui-form-label">上级菜单:</label>
				<div class="layui-input-inline">
					<#treeselect id="menu" name="parent.id" value="${menu.parent.id!}" labelName="parent.name" labelValue="${menu.parent.name!}"
						title="菜单" url="/sys/menu/treeData" extId="${menu.id}" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">名称:</label>
				<div class="layui-input-inline">
					<input type="text" name="name" value="${menu.name}" htmlEscape="false" maxlength="50" class="layui-input" lay-verify="required"/>
				</div>
				<div class="layui-form-mid "><font color="red">*</font> </div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">链接:</label>
				<div class="layui-input-inline">
					<input type="text" name="href" value="${menu.href}" htmlEscape="false" maxlength="2000" class="layui-input"/>
				</div>
				<div class="layui-form-mid layui-word-aux">点击菜单跳转的页面</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">目标:</label>
				<div class="layui-input-inline">
					<input type="text" name="target" value="${menu.target}" htmlEscape="false" maxlength="10" class="layui-input"/>
				</div>
				<div class="layui-form-mid layui-word-aux">链接地址打开的目标窗口，默认：mainFrame</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">图标:</label>
				<div class="layui-input-block">
					<#iconselect id="icon" name="icon" value="${menu.icon}"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">排序:</label>
				<div class="layui-input-inline">
					<input type="text" name="sort" value="${menu.sort}" htmlEscape="false" maxlength="50" class="layui-input" lay-verify="required"/>
				</div>
				<div class="layui-form-mid layui-word-aux"><font color="red">*</font>排列顺序，升序</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">可见:</label>
				<div class="layui-input-inline" >
					<#radio name="isShow" items="${@DictUtils.getDictList('show_hide')}" value="${menu.isShow }"/>
				</div>
				<div class="layui-form-mid layui-word-aux"><font color="red">*</font>该菜单或操作是否显示到系统菜单中</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">权限标识:</label>
				<div class="layui-input-inline">
					<input type="text" name="permission" value="${menu.permission}" htmlEscape="false" maxlength="100" class="layui-input"/>
				</div>
				<div class="layui-form-mid layui-word-aux">控制器中定义的权限标识，如：@RequiresPermissions("权限标识")</div>
			</div>
			<div class="layui-form-item layui-form-text">
				<label class="layui-form-label">备注:</label>
				<div class="layui-input-block">
					<textarea name="remarks" htmlEscape="false" rows="3" maxlength="200" class="layui-textarea">${menu.remarks}</textarea>
				</div>
			</div>
			<div class="layui-form-item layui-hide">
				<div class="layui-input-block">
					<%if(shiro.hasPermission("sys:menu:edit")){%>
						<button class="layui-btn" lay-filter="menuForm" id="menuForm" lay-submit>保 存</button>
					<%}%>
					<button type="reset" class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
				</div>
			</div>
		</form>
	</div>
</div>
<script>
    layui.use(['form','laydate'], function(){
        var form = layui.form,laydate = layui.laydate;
        form.render();
    });
</script>
<%}%>